local util = require("tests.test_util")

describe("treesitter html", function()
  it("parses all symbols correctly", function()
    util.test_file_symbols("treesitter", "./tests/treesitter/html_test.html", {
      {
        col = 0,
        end_col = 15,
        end_lnum = 1,
        kind = "Module",
        level = 0,
        lnum = 1,
        name = "<!DOCTYPE html>",
      },
      {
        children = {
          {
            col = 6,
            end_col = 15,
            end_lnum = 3,
            kind = "Field",
            level = 1,
            lnum = 3,
            name = "lang",
          },
          {
            children = {
              {
                children = {
                  {
                    col = 10,
                    end_col = 25,
                    end_lnum = 5,
                    kind = "Field",
                    level = 3,
                    lnum = 5,
                    name = "charset",
                  },
                },
                col = 4,
                end_col = 28,
                end_lnum = 5,
                kind = "Struct",
                level = 2,
                lnum = 5,
                name = "meta",
              },
              {
                children = {
                  {
                    col = 10,
                    end_col = 28,
                    end_lnum = 6,
                    kind = "Field",
                    level = 3,
                    lnum = 6,
                    name = "name",
                  },
                  {
                    col = 29,
                    end_col = 55,
                    end_lnum = 6,
                    kind = "Field",
                    level = 3,
                    lnum = 6,
                    name = "content",
                  },
                },
                col = 4,
                end_col = 58,
                end_lnum = 6,
                kind = "Struct",
                level = 2,
                lnum = 6,
                name = "meta",
              },
              {
                col = 4,
                end_col = 29,
                end_lnum = 7,
                kind = "Struct",
                level = 2,
                lnum = 7,
                name = "title",
              },
              {
                children = {
                  {
                    col = 10,
                    end_col = 26,
                    end_lnum = 8,
                    kind = "Field",
                    level = 3,
                    lnum = 8,
                    name = "rel",
                  },
                  {
                    col = 27,
                    end_col = 41,
                    end_lnum = 8,
                    kind = "Field",
                    level = 3,
                    lnum = 8,
                    name = "href",
                  },
                },
                col = 4,
                end_col = 44,
                end_lnum = 8,
                kind = "Struct",
                level = 2,
                lnum = 8,
                name = "link",
              },
              {
                col = 4,
                end_col = 12,
                end_lnum = 13,
                kind = "Struct",
                level = 2,
                lnum = 9,
                name = "style",
              },
            },
            col = 2,
            end_col = 9,
            end_lnum = 14,
            kind = "Struct",
            level = 1,
            lnum = 4,
            name = "head",
          },
          {
            children = {
              {
                col = 8,
                end_col = 20,
                end_lnum = 15,
                kind = "Field",
                level = 2,
                lnum = 15,
                name = "class",
              },
              {
                children = {
                  {
                    children = {
                      {
                        col = 10,
                        end_col = 24,
                        end_lnum = 17,
                        kind = "Field",
                        level = 4,
                        lnum = 17,
                        name = "id",
                      },
                    },
                    col = 6,
                    end_col = 41,
                    end_lnum = 17,
                    kind = "Struct",
                    level = 3,
                    lnum = 17,
                    name = "h1",
                  },
                  {
                    col = 6,
                    end_col = 27,
                    end_lnum = 18,
                    kind = "Struct",
                    level = 3,
                    lnum = 18,
                    name = "p",
                  },
                  {
                    col = 6,
                    end_col = 12,
                    end_lnum = 20,
                    kind = "Struct",
                    level = 3,
                    lnum = 20,
                    name = "hr",
                  },
                  {
                    children = {
                      {
                        children = {
                          {
                            children = {
                              {
                                col = 14,
                                end_col = 27,
                                end_lnum = 24,
                                kind = "Struct",
                                level = 6,
                                lnum = 24,
                                name = "th",
                              },
                              {
                                col = 27,
                                end_col = 44,
                                end_lnum = 24,
                                kind = "Struct",
                                level = 6,
                                lnum = 24,
                                name = "th",
                              },
                            },
                            col = 10,
                            end_col = 49,
                            end_lnum = 24,
                            kind = "Struct",
                            level = 5,
                            lnum = 24,
                            name = "tr",
                          },
                        },
                        col = 8,
                        end_col = 16,
                        end_lnum = 25,
                        kind = "Struct",
                        level = 4,
                        lnum = 23,
                        name = "thead",
                      },
                      {
                        children = {
                          {
                            children = {
                              {
                                col = 14,
                                end_col = 29,
                                end_lnum = 27,
                                kind = "Struct",
                                level = 6,
                                lnum = 27,
                                name = "td",
                              },
                              {
                                col = 29,
                                end_col = 39,
                                end_lnum = 27,
                                kind = "Struct",
                                level = 6,
                                lnum = 27,
                                name = "td",
                              },
                            },
                            col = 10,
                            end_col = 44,
                            end_lnum = 27,
                            kind = "Struct",
                            level = 5,
                            lnum = 27,
                            name = "tr",
                          },
                          {
                            children = {
                              {
                                col = 14,
                                end_col = 30,
                                end_lnum = 28,
                                kind = "Struct",
                                level = 6,
                                lnum = 28,
                                name = "td",
                              },
                              {
                                col = 30,
                                end_col = 40,
                                end_lnum = 28,
                                kind = "Struct",
                                level = 6,
                                lnum = 28,
                                name = "td",
                              },
                            },
                            col = 10,
                            end_col = 45,
                            end_lnum = 28,
                            kind = "Struct",
                            level = 5,
                            lnum = 28,
                            name = "tr",
                          },
                        },
                        col = 8,
                        end_col = 16,
                        end_lnum = 29,
                        kind = "Struct",
                        level = 4,
                        lnum = 26,
                        name = "tbody",
                      },
                    },
                    col = 6,
                    end_col = 14,
                    end_lnum = 30,
                    kind = "Struct",
                    level = 3,
                    lnum = 22,
                    name = "table",
                  },
                },
                col = 4,
                end_col = 10,
                end_lnum = 31,
                kind = "Struct",
                level = 2,
                lnum = 16,
                name = "div",
              },
              {
                col = 4,
                end_col = 13,
                end_lnum = 35,
                kind = "Struct",
                level = 2,
                lnum = 33,
                name = "script",
              },
            },
            col = 2,
            end_col = 9,
            end_lnum = 36,
            kind = "Struct",
            level = 1,
            lnum = 15,
            name = "body",
          },
        },
        col = 0,
        end_col = 7,
        end_lnum = 37,
        kind = "Struct",
        level = 0,
        lnum = 3,
        name = "html",
      },
    })
  end)
end)
